﻿<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>奋青网-帖子列表</title>
<link href="css/Main.css" rel="stylesheet" type="text/css" />
<link href="css/Article.css" rel="stylesheet" type="text/css" />
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/boxy.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/Jquery-1-5-2.js"></script>
<script type="text/javascript" src="js/Main.js"></script>
<script type="text/javascript" src="js/Article.js"></script>
<script type="text/javascript" src="js/jquery.boxy.js"></script>
<script src="js/redactor/redactor.js"></script>
<link href="js/redactor/css/redactor.css" rel="stylesheet"  type="text/css" />
<script type="text/javascript">
<!--
	function getType1(tid){
		if(tid==0){
			window.location.href="${applicationScope.path }/ArticleList?type=0" ;
		}else if(tid==2){
			window.location.href="${applicationScope.path }/ArticleList?type=2" ;
		}else{
			window.location.href="${applicationScope.path }/ArticleList?type=1" ;
		}
	}
-->
</script>
<script type="text/javascript">
<!--
	function getType(){
		var type = document.form1.type ;
		var action = document.form1.action ;
		action = action.value ;
		var form = document.form1 ;
		if(type.value==2){
			form.action="${applicationScope.path }/Active";
		}else if(type.value==1){
			form.action="${applicationScope.path }/ArticleList";
		}
	}
-->
</script>
</head>

<body>
<div id="Top">
  <div class="Top_all"> <a href="#"><img src="images/LOGO.jpg"/></a>
    <ul id="Top_Nav">
      <li><a href="${applicationScope.path }/Index">首页</a></li>
      <li><a href="${applicationScope.path }/ArticleList">领域</a></li>
      <li><a href="#">发现</a></li>
    </ul>
    <ul id="Second_Menu">
      	<li><a href="${applicationScope.path }/ClubList">发现社团</a><li>
      	<li><a href="#">对味奋青</a><li>
      	<li><a href="${applicationScope.path }/Active">有趣活动</a><li>
      </ul>
    <div id="Search">
      <div class="Search_l"></div>
      <form name="form1" method="post" action="" onsubmit="getType();">
      	<input type="hidden" name="action" value="search" />
        <input type="text" id="Search_Box" name="content" value="搜索社团、文章、活动..."/>
        <img src="images/search_btn.jpg" id="Search_Btn"/>
        <input type="hidden" value="0" id="Search_What" name="type"/>  <!--传送搜索类型参数-->
      </form>
    </div>
    <div id="Search_Option">
    	<p class="Search_Option_Hover"><img src="images/search_hover0.jpg"/>包含<span></span>的社团</p>
    	<p><img src="images/search_hover1.jpg"/>包含<span></span>的帖子</p>
    	<p><img src="images/search_hover2.jpg"/>包含<span></span>的活动</p>
    </div>
    <div id="User_Top">
    <c:choose>
    	<c:when test="${not empty sessionScope.user}">
    	<c:forEach items="${requestScope.login}" var="login">
    		<img src="${login.uphoto}"/><a href="#">${login.uname}</a>
        	<ul id="User_Info_Box">
	        	<li><a href="${applicationScope.path }/Pro?uid=${login.uid}"><img src="images/home.jpg"/>个人主页</a></li>
	        	<li><a href="${applicationScope.path }/Pro?uid=${login.uid}&lx=private"><img src="images/sms.jpg"/>私信</a></li>
	        	<li><a href="${applicationScope.path }/Pro?uid=${login.uid}&lx=edit"><img src="images/control.jpg"/>设置</a></li>
	        	<li><a href="${applicationScope.path }/Logout.jsp"><img src="images/logout.jpg"/>注销</a></li>
        	</ul>
        </c:forEach>
    	</c:when>
   	 	<c:otherwise>
    		<a href="${applicationScope.path }/Entrance.jsp">您还未登录</a>
    	</c:otherwise>
    </c:choose>
    </div>
    <img src="images/help.jpg" id="Help_Btn" title="帮助中心"/> </div>
</div>
<!--头部结束-->
<div class="Page_Top"></div>
<div class="Page_Middle">
  <div class="Page_Left">
    <p class="Page_Title">帖子列表</p>
    <div class="Title_Line"></div>
    <div class="Page_Main">
    	<div class="Pro_Change">
    		<c:choose>
    			<c:when test="${requestScope.type=='1'}">
    				<input type="button" class="Pro_Change_Btn" onclick="getType1(0);" value='推荐'/>
    				<input type="button" class="Join_Btn" onclick="getType1(1);" value='问题帖'/>
    				<input type="button" class="Pro_Change_Btn" onclick="getType1(2);" value='分享帖'/>
    			</c:when>
    			<c:otherwise>
    				<c:choose>
    					<c:when test="${requestScope.type=='2'}">
    						<input type="button" class="Pro_Change_Btn" onclick="getType1(0);" value='推荐'/>
        					<input type="button" class="Pro_Change_Btn" onclick="getType1(1);" value='问题帖'/>
        					<input type="button" class="Join_Btn" onclick="getType1(2);" value='分享帖'/>
    					</c:when>
    					<c:otherwise>
    						<input type="button" class="Join_Btn" onclick="getType1(0);" value='推荐'/>
        					<input type="button" class="Pro_Change_Btn" onclick="getType1(1);" value='问题帖'/>
        					<input type="button" class="Pro_Change_Btn" onclick="getType1(2);" value='分享帖'/>
    					</c:otherwise>
    				</c:choose>
    			</c:otherwise>
    		</c:choose>
        </div>
        <c:choose>
        <c:when test="${requestScope.type=='1'}">
	        <c:forEach items="${requestScope.problem}" var="pro" begin="${requestScope.start}" end="${requestScope.end}">
		    	<div class="Article_List">
		        	<img src="${pro.uphoto}" class="User_Pic"/><a href="${applicationScope.path }/Post?pid=${pro.pid}">${pro.ptitle}</a>
		            <div class="Article_List_Info">
		            	分类：问题&nbsp;&nbsp;&nbsp;&nbsp;领域：${pro.ftype}&nbsp;&nbsp;&nbsp;&nbsp;标签：${pro.ptag }&nbsp;&nbsp;&nbsp;&nbsp;发布时间：${pro.date2}&nbsp;&nbsp;&nbsp;&nbsp;已有<font color='red'>${pro.atend}</font>条回复
		            </div>
		        </div>
	        </c:forEach>
        </c:when>
        <c:otherwise>
        	<c:choose>
        		<c:when test="${requestScope.type=='2'}">
        			<c:forEach items="${requestScope.share}" var="share" begin="${requestScope.start}" end="${requestScope.end}">
        			<div class="Article_List">
			        	<img src="${share.uphoto}" class="User_Pic"/><a href="${applicationScope.path }/QApage?pid=${share.cdid}">${share.cdtitle}</a>
			            <div class="Article_List_Info">
			            	分类：分享&nbsp;&nbsp;&nbsp;&nbsp;领域：${share.ftype }&nbsp;&nbsp;&nbsp;&nbsp;标签：${share.cdtag }&nbsp;&nbsp;&nbsp;&nbsp;发布时间：${share.date2}&nbsp;&nbsp;&nbsp;&nbsp;已有<font color='red'>${share.atend}</font>条回复
			            </div>
		        	</div>
		        </c:forEach>
		        <c:if test="${empty requestScope.share}"></c:if>
        		</c:when>
        		<c:otherwise>
        			<c:choose>
        				<c:when test=""></c:when>
        				<c:otherwise>
        					<div class="Article_List">
			        			暂没有数据
			            		<div class="Article_List_Info"></div>
		        			</div>
        				</c:otherwise>
        			</c:choose>
        		</c:otherwise>
        	</c:choose>
        </c:otherwise>
        </c:choose>
    </div>
    <div class="Pages">
        <a href="?type=${requestScope.type}&page=1" class="Pages_a">首  页</a>
    	<c:choose>
        	<c:when test="${requestScope.page>1 }">
        		<a href="?type=${requestScope.type}&page=${requestScope.page -1 }" class="Pages_a">上一页</a>
        	</c:when>
        	<c:otherwise>
				<a class="Pages_a">上一页</a>        	
        	</c:otherwise>
        </c:choose>
    	<c:forEach items="${requestScope.count}" var="page">
        </c:forEach>
        <c:choose>
        <c:when test="${requestScope.page+1>requestScope.csize}">
        <a class="Pages_a">下一页</a>
        <a href="?type=${requestScope.type}&page=${requestScope.csize }" class="Pages_a">末页</a>
        </c:when>
        	<c:otherwise>
        		<a href="?type=${requestScope.type}&page=${requestScope.page +1 }" class="Pages_a">下一页</a>
        		<a href="?type=${requestScope.type}&page=${requestScope.csize }" class="Pages_a">末页</a>
        	</c:otherwise>
        </c:choose>
    </div>
  </div>
  <div class="Page_Right">
  	<input type="button" class="Green_Button" value="发表帖子"/>
    <div class="Page_Tops">
    	<div class="Page_Tops_Title">
        	<p>热门帖子</p>
        </div>
    	<ul>
        	<c:forEach items="${requestScope.hot}" var="card">
    		<c:choose>
    			<c:when test="${card.cdagree<=3}">
				        <li><span class="Page_Tops_Code1">${card.cdagree}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:when>
				<c:otherwise>
				        <li><span class="Page_Tops_Code2">${card.cdagree}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:otherwise>
			</c:choose>
          	</c:forEach>
        </ul>
    </div>
    <div class="Page_Tops">
    	<div class="Page_Tops_Title">
        	<p>人气奋青</p>
        </div>
    	<ul>
        	<c:forEach items="${requestScope.hot}" var="card">
    		<c:choose>
    			<c:when test="${card.cdagree<=3}">
				        <li><span class="Page_Tops_Code1">${card.cdagree}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:when>
				<c:otherwise>
				        <li><span class="Page_Tops_Code2">${card.cdagree}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:otherwise>
			</c:choose>
          	</c:forEach>
        </ul>
    </div>
  </div>
</div>
<div class="Page_Bottom"></div>
<!--版权部分-->
<div class="Bottom">
  <p><a href="#"><img src="images/LOGO_gray.jpg" align="left" /></a> <a href="#">奋青首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">社团中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">交流圈子</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">活动中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">帮助中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">使用反馈</a>&nbsp;&nbsp;|&nbsp;&nbsp;联系我们：<a href="mailto:scdzwyxst@gmail.com">scdzwyxst@gmail.com</a>&nbsp;&nbsp;<br />
    CopyRight&copy;&nbsp;2012&nbsp;MayDay  All Rights Reserved</p>
</div>
</body>
</html>
